/*
 * author      : dormi330 
 * date        : 2018/7/19
 * description : TODO
 */

package com.deep.trade.domain.order.event;

import com.deep.trade.application.order.OrderQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderEventFactory {

    private static OrderQueryService orderQueryService;

    public static EventFinished eventFinished(String tradeOrderId) throws Exception {
        return new EventFinished(orderQueryService.tradeOrderDetail(tradeOrderId));
    }

    public OrderQueryService getOrderQueryService() {
        return orderQueryService;
    }

    @Autowired
    public void setOrderQueryService(OrderQueryService orderQueryService) {
        OrderEventFactory.orderQueryService = orderQueryService;
    }
}
